<?php
// +----------------------------------------------------------------------
// | Copyright (c) 2018-2018 http://www.donglixia.net All rights reserved.
// +----------------------------------------------------------------------
// | Author: 十万马 <962863675@qq.com>
// +----------------------------------------------------------------------
// | DateTime: 2018-02-09 16:17
// +----------------------------------------------------------------------

namespace app\english\controller;

use app\index\model\Article;
use think\Request;

class Index extends Base
{
    public function __construct(Request $request = null)
    {
        parent::__construct($request);
        $this->currentModel = new Article();//实例化当前模型
    }

    public function index()
    {
        //轮播图
        $banner_list = $this->currentModel->getDataList(['cat_id'=>146]);
        $this->assign('banner_list', $banner_list);

        //首页内容区
        $content_list = $this->currentModel->getDataList(['cat_id'=>147]);
        $this->assign('content_list', $content_list);

        //最新资讯
        $_GET['limit'] = 3;//每页数量
        $cat_ids = $this->currentModel->getCatIdByCatType(['cat_type'=>['in', [205,206]]]);//类型：信息中心，活动中心
        $latest_list = $this->currentModel->getDataList(['cat_id'=>['in', $cat_ids]]);
        $this->assign('latest_list', $latest_list);
        return $this->fetch();
    }
}
